package demo1;

/**
 * 多线程情况下测试饿汉模式 ,10个线程
 */
public class DEMO_01 {
    public static void main(String[] args) {
        Thread[] threads=new Thread[10];
        for (int i = 0; i < threads.length ; i++) {
            threads[i]=new Thread(()->{
                SingleHungry instance= SingleHungry.get();
                System.out.println(instance);
            });
        }
        for (Thread t:threads
             ) {
            t.start();
        }
    }

}
